package com.leo;

import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.effect.DropShadow;
import javafx.scene.layout.AnchorPane;
import javafx.stage.Stage;

/**
 * @ClassName Summary
 * @Description 总结：边界问题
 * @Author wangss
 * @date 2020.05.26 22:13
 * @Version 1.0
 */
public class Summary4 extends Application {

    public static void main(String[] args) {
        launch(args);
    }

    @Override
    public void start(Stage primaryStage) throws Exception {
        AnchorPane anchorPane = new AnchorPane();
        anchorPane.setStyle("-fx-background-color: #e7eeea");
        Scene scene = new Scene(anchorPane);

        Button button = new Button("button");
        button.setEffect(new DropShadow());

        // 旋转
        button.setRotate(45d);

        AnchorPane.setTopAnchor(button, 100d);
        AnchorPane.setLeftAnchor(button, 100d);
        anchorPane.getChildren().addAll(button);

        primaryStage.setScene(scene);
        primaryStage.setTitle("spinner");
        primaryStage.setWidth(625d);
        primaryStage.setHeight(500d);
        primaryStage.setResizable(false);
        primaryStage.show();

        System.out.println(button.getLayoutBounds());
        System.out.println(button.getBoundsInLocal());
        System.out.println(button.getBoundsInParent());
    }
}
